# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jeb-android
pkgver=3.7.0.201909272058
pkgrel=1
pkgdesc='Android decompiler.'
arch=('any')
groups=('blackarch' 'blackarch-reversing' 'blackarch-mobile')
url='https://www.pnfsoftware.com/jeb/android'
depends=('java-environment' 'java-runtime-common')
source=('https://www.pnfsoftware.com/dl?jebdemoandroid')
sha512sums=('7a8aa65a45172fc26fa0c14061cba598ac71f52fcd83724e32c4d912209c90385a2be592eaafc5651adf2384162d25a890a43da118787f5af650f3218c1c5fd3')

pkgver() {
  cat bin/VERSION.TXT
}

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/opt/$pkgname"

  rm -rf 'dl?jebdemoandroid'

  cp --no-preserve=ownership -r * "$pkgdir/opt/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /opt/$pkgname
exec ./jeb_linux.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

